<template>
  <div class="user">
    <!-- 个人中心头部 -->
    <common-head title="个人中心" />
    <!-- 中间信息 -->
    <div class="warp">
      <div class="userinformation">
        <div class="userhead" v-if="show">
          <div class="touxiang">
             <img src="../../assets/imgs/微信图片_20210617160200.jpg" alt="">
          </div>
         <p>我的温暖</p>
        </div>
        <div class="userinformation-notlogin"  v-if="!show">
          <p>Hi,欢迎来到花礼网</p>
         <button @click="$router.push('/login')">登录/注册</button>
        </div>
      </div>
      <div class="panel">
          <div class="dingdan">
              <p>我的订单</p>
              <p>
                <span>全部订单</span>
                <van-icon size="18" name="arrow" />
              </p>
          </div>
          <div class="dingbox">
              <div class="ico">
                <img src="https://img02.hua.com/m/member/center/myinfo_pendingpay.png" alt="">
                <p>我的订单</p>
              </div>
              <div class="ico">
                <img src="https://img02.hua.com/m/member/center/myinfo_distribution.png" alt="">
                <p>今日配送</p>
              </div>
              <div class="ico">
                <img src="https://img02.hua.com/m/member/center/myinfo_evaluation.png" alt="">
                <p>评价有礼</p>
              </div>
          </div>
      </div>
      <div class="youhui">
          <van-grid :column-num="4">
            <van-grid-item  icon="cash-on-deliver" text="优惠券" />
            <van-grid-item icon="paid" text="权益卡" />
            <van-grid-item icon="gold-coin-o" text="余额" />
            <van-grid-item icon="gem-o" text="会员积分" />
            <van-grid-item icon="location-o" @click="$router.push('/contactList')" text="收货地址" />
            <van-grid-item icon="shop-collect-o" text="生日提醒" />
            <van-grid-item icon="star-o" text="我的收藏" />
            <van-grid-item icon="clock-o" text="浏览记录" />
          </van-grid>
      </div>
      <div class="kefu">
        <van-grid>
          <van-grid-item icon="service-o" text="联系客服" />
          <van-grid-item icon="question-o" text="帮助中心" />
          <van-grid-item icon="info-o" text="关于花礼" />
          <van-grid-item icon="setting-o" text="设置" />
        </van-grid>
      </div>
    </div>
    <!-- 个人中心尾部 -->
    <tabbar />
  </div>
</template>

<script>
import Tabbar from '@components/tabbar'
import CommonHead from '../../components/CommonHead.vue'
export default {
  components: {
    Tabbar,
    CommonHead
  },
  data () {
    return {
      show: localStorage.getItem('token')
    }
  }

}
</script>

<style lang="scss" scoped>
.user{
  background: #E9ECF0;
}
.warp{
  padding: 46px 0 50px 0;
  .userinformation{
  height: 140px;
  background: url(https://img02.hua.com/m/member/center/backgroundv3.png);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  color: #fff;
  .userhead{
    margin-bottom: 20px;
    text-align: center;
  }
  .touxiang{
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    img{
      width: 100%;
    }
  }
  .userinformation-notlogin{
    margin-bottom: 22px;
    p{
      margin-bottom: 10px;
      text-align: center;
    }
    button{
      width: 126px;
      height: 36px;
      background-color: #fff;
      outline: 0;
      border: 0;
      border-radius: 20px;
      color: black;
    }
  }
  }
  .panel{
    background-color: #fff;
    margin: -20px 15px 15px 15px;
    display: flex;
    flex-direction: column;
    padding: 0 15px;
    border-radius: 6px;
    .dingdan{
      display: flex;
      justify-content: space-between;
      border-bottom:1px solid #ccc;
      font-size: 14px;
      height: 44px;
      line-height: 44px;
      p{
        display: flex;
        justify-content: center;
        align-items: center;
      }
    }
    .dingbox{
      display: flex;
      font-size: 12px;
      justify-content: space-around;
      height: 72px;
      .ico{
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
      }
      img{
        width: 32px;
        height: 32px;
      }
    }
  }
  .youhui{
    margin: 15px;
    border-radius: 6px;
    overflow: hidden;
  }
  .kefu{
    margin: 15px;
    border-radius: 6px;
    overflow: hidden;
  }
}
</style>
